package api

import request "gitee.com/changeden/volcengine-livesaas-request-go"

type GetPageWatchDataRequest struct {
	ActivityId *int64 `json:"ActivityId"`
	Soucre     *int32 `json:"Soucre"`
}
type GetPageWatchDataResponse struct {
	ActivityID int64      `json:"ActivityId" gorm:"column:ActivityId"`
	PageClicks PageClicks `json:"PageClicks" gorm:"column:PageClicks"`
}
type PageClicks struct {
	UV        int32 `json:"UV" gorm:"column:UV"`
	AvgNumber int32 `json:"AvgNumber" gorm:"column:AvgNumber"`
	PV        int32 `json:"PV" gorm:"column:PV"`
	TotalTime int64 `json:"TotalTime" gorm:"column:TotalTime"`
	AvgTime   int64 `json:"AvgTime" gorm:"column:AvgTime"`
}

func (instance *Instance) GetPageWatchData(data *GetPageWatchDataRequest) (*GetPageWatchDataResponse, error) {
	d := request.Data{
		Action: "GetPageWatchDataAPI",
	}
	bindQuery(&d, *data)
	var res GetPageWatchDataResponse
	err := instance.get(&d, &res)
	return &res, err
}
